﻿using log4net;
using log4net.Config;
using log4net.Util;
using System;

namespace ZhongchenZhou.log4net.Appender.SP.SampleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Start on " + DateTime.Now.ToLongTimeString());
            Console.WriteLine();

            LogWithXmlConfigurator();

            Console.WriteLine();
            Console.WriteLine("Finish on " + DateTime.Now.ToLongTimeString());            
            Console.ReadLine();
        }

        private static void LogWithXmlConfigurator()
        {
            XmlConfigurator.Configure();

            LogLog.InternalDebugging = true;

            ILog log = LogManager.GetLogger(typeof(Program));

            log.Debug("This is a debug message.");
            log.Error("This is a error message.");
            log.Fatal("This is a fatal message.");
            log.Info("This is a info message.");
            log.Warn("This is a warn message.");
        }
    }
}
